from datetime import timedelta
from redis import StrictRedis

class Config(object):
    DEBUG = True
    #秘钥
    SECRET_KEY = "asdfasdfiaofasdjkafjlasigdoasdafoiwoef"

    # 以下数据库mysql配置
    SQLALCHEMY_DATABASE_URI = "mysql://root:mysql@127.0.0.1:3306/ihome"
    SQLALCHEMY_TRACK_MODIFICATIONS = False

    # Redis配置
    REDIS_HOST = "127.0.0.1"
    REDIS_PORT = 6379


    # Session配置
    SESSION_TYPE = "redis"
    SESSION_REDIS = StrictRedis(host=REDIS_HOST, port=REDIS_PORT)
    SESSION_USE_SIGNER = True
    PERMANENT_SESSION_LIFETIME = timedelta(seconds=3600 * 12)

    #七
    QINIU_URL = "http://pr4eo8v5p.bkt.clouddn.com/"